package com.stox.client.ui.javafx.chartingy.persistence.chart.dto;

import com.stox.client.ui.javafx.chartingy.model.chart.Chart;
import com.stox.client.ui.javafx.chartingy.model.plot.IndicatorPlot;
import com.stox.client.ui.javafx.chartingy.model.plot.Plot;

public class SecondaryChartDTO extends ChartDTO<IndicatorPlotDTO> {
	private static final long serialVersionUID = 1L;

	public SecondaryChartDTO() {
		
	}
	
	public SecondaryChartDTO(Chart<?,?> chart) {
		super(chart);
		setPrimaryPlot(new IndicatorPlotDTO((IndicatorPlot<?, ?>) chart.getPrimaryPlot()));
		for(Plot<?,?> plot : chart.getPlots()){
			if(plot instanceof IndicatorPlot){
				getPlots().add(new IndicatorPlotDTO((IndicatorPlot<?,?>)plot));
			}
		}
	}
	
}
